% -*-LaTeX-*-
% Converted automatically from troff to LaTeX by tr2tex on Tue Dec 18 11:07:47 1990
% tr2tex was written by Kamal Al-Yahya at Stanford University
% (Kamal%Hanauma@SU-SCORE.ARPA)


\documentstyle[troffman]{article}
\begin{document}
%
% input file: fbsample.1
%
\phead{FBSAMPLE}{1}{25-Jun-90}

%.CM 3
\shead{NAME}
fbsample -- convert 1bit image to grayscale by sampling
\shead{SYNOPSIS}
\nofill
fbsample [ -t'title' -c'credits' -g'grain' -n'nbr']
         [ -$<$type$>$ ] $<$ bitmap $>$ image
\fill
\shead{DESCRIPTION}
\par
Samples a 1 bit deep pbm file using a square neighborhood of the
specified size, and outputs an 8 bit file.  You will want to run
{\it fbnorm}
on the output to expand the scale to 255, and there will be a small
loss of sharpness, so
{\it fbsharp}
will also be useful.  Once you have an 8 bit file, you can resize it
arbitrarily, and then convert it back to a 1 bit file, if need be.
The default neighborhood size is 8 by 8, which gives 65 different gray
levels.
\shead{OPTIONS}
\begin{TPlist}{{\bf -g}}
\item[{{\bf -g}}]
{\it grain}
size.  The sample is taken every
{\it grain}
pixels.
\item[{{\bf -n}}]
{\it neighborhood}
size.  The value will be the number of light pixels in the nearby NxN
square.  The values can range from 1 to 16.
\item[{{\bf -t'title'}
}]
{\it title,}
specify a character string (up to 80 characters) to describe the image.
The default is no title.
\item[{{\bf -c'credits'}
}]
{\it credits} or subtitle,
specify a second character string (up to 80 characters) to describe the
image.  The default is no credit string.
\item[{{\bf -B}
}]
{\it face}
format, as used by Bennet Yee's
{\it face}
program at CMU. 
\item[{{\bf -F}
}]
{\it FBM,}
format (by default, the default).  You are guaranteed not
to lose information by specifying FBM as the default.
\item[{{\bf -G}
}]
{\it GIF,}
Compuserve GIF format.
\item[{{\bf -I}
}]
{\it IFF}
format, interleaved bitmaps (ILBM), used by Amigas.
\item[{{\bf -P}
}]
{\it PBM,}
Jef Poskanzer's bitmap format.
\item[{{\bf -S}
}]
{\it sun,}
Sun rasterfiles (not run length encoded).
\end{TPlist}
\shead{EXAMPLE}
\par
Suppose you have a 480 by 600 face format file (-B) that you wish to
shrink to 300 by 375 and convert to PostScript (say for inclusion 
in your door label).  Here's a pipeline to do that:
\par\vspace{1.0\baselineskip}
\nofill
    \% fbsample -n5 -g1 $<$ my.face $|$ \    \# sample 5x5
      fbnorm -b4 -w1 $|$                  \# normalize
      fbext -w300 $|$ \                   \# make 300 pixels wide
      fbhalf -s20 $|$ \                   \# halftone and really sharpen
      pbm2ps -s 1 $>$ sdoor.ps            \# convert to postscript
\fill
\shead{SEE ALSO}
fbnorm(1) to normalize the output,
fbm(1) for general discussion, pbm(1) for PBM routines.
\shead{BUGS}
None known.
\shead{HISTORY}
Copyright (C) 1989,1990 by Michael Mauldin.  Permission is granted
to use this file in whole or in part for any purpose, educational,
recreational or commercial, provided that this copyright notice
is retained unchanged.  This software is available to all free of
charge by anonymous FTP and in the UUNET archives.
\begin{TPlist}{25-Jun-90  Michael Mauldin at Carnegie Mellon University}
\item[{25-Jun-90  Michael Mauldin at Carnegie Mellon University}]
Release 1.0 mlm@cs.cmu.edu
\item[{07-Mar-89  Michael L. Mauldin at Carnegie Mellon University}]
Beta release (version 0.9) mlm@cs.cmu.edu
\end{TPlist}
\end{document}
